﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

namespace HHXX.IDAL
{
    public interface IBaseDal<T> where T : class, new()
    {
        T GetModel(int id);
        T GetModel(object id);
        IQueryable<T> GetEntities(Expression<Func<T, bool>> whereLambda);

        T Add(T T);
        bool Update(T T);
        bool Delete(T T);
        bool IsExist(object id);

        IQueryable<T> GetPageEntities<S>(int pageSize, int pageIndex, out int total, Expression<Func<T, bool>> whereLambda
            , Expression<Func<T, S>> orderByLambda, bool isAsc);
        bool Delete(int id);
        int DeleteListByLogical(List<int> ids);

    }
}
